package PayrollCalculation;

abstract public class Employee {
    protected String name;
    protected double baseSalary;
    //此处指计算奖金的基本基数，并非奖金的金额且奖金计算方式会随不同工种变化
    protected double performance;

    public Employee(String name, double baseSalary, double performance) {
        this.name = name;
        this.baseSalary = baseSalary;
        this.performance = performance;
    }

    //抽象方法
    public abstract double calculateSalary();

    @Override
    public String toString() {
        return String.format("%s(工种：%s) - 工资: %.2f", name, this.getClass().getSimpleName(), calculateSalary());
    }
}
